UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xGryybkcx995+fXZhdFk9w9EmSM+V38Y9wxWwWpGAts='
WHERE
key_id = 'fb1843d556a83bfde70c9b73241e9398cd374f61c6df16d7b6145dfa64deaeae'
AND (
token = 'xGryybkcx995+fXZhdFk9w9EmSM+V38Y9wxWwWpGAts='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)