UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'idWShHxy9OVhBoIVSVPDk7ac4+uCLVZTG1JjW84IVsM='
WHERE
key_id = '9aa2fb435adb5679778ea1682df6ed03926a525e97d5893bbd0c15268e39da57'
AND (
token = 'idWShHxy9OVhBoIVSVPDk7ac4+uCLVZTG1JjW84IVsM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)