UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rcFwGIpqUhmXBBkOHXDZq4UVu6n4YWGtWFUD6jgFcHc='
WHERE
key_id = 'a14841bb235a6941d395513b460d2727f1075bcdd312125ead0f620c707799db'
AND (
token = 'rcFwGIpqUhmXBBkOHXDZq4UVu6n4YWGtWFUD6jgFcHc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)