UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MTjT6NMOG6hEXGpQI/HELCnVQmIvJukVduB0PtoXtBU='
WHERE
key_id = 'ab3d590eb542bff1b74216a066e167a0888f96bc93fccba0f730463a346fcd54'
AND (
token = 'MTjT6NMOG6hEXGpQI/HELCnVQmIvJukVduB0PtoXtBU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)