UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xcS6TueedM8KF/tWUE3NWBIhGQlW/uZEQXP+3ji6JRA='
WHERE
key_id = '68882113ede258273fdb3fc956b05945a110678739e234476c976b2791e8d261'
AND (
token = 'xcS6TueedM8KF/tWUE3NWBIhGQlW/uZEQXP+3ji6JRA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)