UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5rLeewRo5utSlupexN35Z+RF2xJhLMQErxP3KXib6Do='
WHERE
key_id = '5e1c84ea306f784733b4842343bbad1252c33005283c268535ff9ec3d93619fa'
AND (
token = '5rLeewRo5utSlupexN35Z+RF2xJhLMQErxP3KXib6Do='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)