UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8VSjdshNCkmZDTpRMh2bih+iljlDLhgHKSnWlQzqaTI='
WHERE
key_id = '1cda975e7d67429d3c10d1aa9844dc1eb0ca6b7e4b0c17ba182ed07dde01bd48'
AND (
token = '8VSjdshNCkmZDTpRMh2bih+iljlDLhgHKSnWlQzqaTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)