UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oqbsQty4NUpShHJEfaZyhBX0y0yik+e/5nBu1NoJNJ8='
WHERE
key_id = '7558b3d156d80797bf7751f51b324461df88f5dba27d8674cba2e4a50c8a2d3c'
AND (
token = 'oqbsQty4NUpShHJEfaZyhBX0y0yik+e/5nBu1NoJNJ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)