UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fUylgT7F6d9G2xw4I68QB7pbsGe2Tvmzom3HPKkplrQ='
WHERE
key_id = '001ecabe3d7098c01730e144ba73720a45459dde0514c71574c1c566c54e8e36'
AND (
token = 'fUylgT7F6d9G2xw4I68QB7pbsGe2Tvmzom3HPKkplrQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)