UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rMZHdlB9cahBQ/6EfDTHIYF2o4284QLLND3duxToyGg='
WHERE
key_id = 'ff983f11d4b6fd641de1d3df3064ead830bab601a2a54fc3758804d5ed5c8fea'
AND (
token = 'rMZHdlB9cahBQ/6EfDTHIYF2o4284QLLND3duxToyGg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)