UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5Yfly4LFCNuVSRU27ZxBfgsWioFt0A/iq1WSRa2h9DE='
WHERE
key_id = 'dbb30bd2ae25ec32f702e2be55a585216365671d20d6c49ad3ed17fc9276887f'
AND (
token = '5Yfly4LFCNuVSRU27ZxBfgsWioFt0A/iq1WSRa2h9DE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)