UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4ok6qJbDorddXyj/POgLsjABNtXcXgR1XV9gzSHYcr4='
WHERE
key_id = 'e99cbd151cc87aec27de323d4d22f2ec85db10489cb09082ebf038aa7977adb5'
AND (
token = '4ok6qJbDorddXyj/POgLsjABNtXcXgR1XV9gzSHYcr4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)