UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pfxt8E3hJR8oogt2hQ4wd3rLImAyJ5aJDnZXrAt5uG8='
WHERE
key_id = '5dd3260b9e2ad49a77447de05c37e72e1967589bb62e72e6d50582165005baf1'
AND (
token = 'pfxt8E3hJR8oogt2hQ4wd3rLImAyJ5aJDnZXrAt5uG8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)