UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sLoTbB/1AZVdgh30sRyGyDJ7SDutKJE55Dozup9Eeas='
WHERE
key_id = 'ef75cced71f8a28334cc061354f54023931c381be786f08cc7aa5f7912e85ed2'
AND (
token = 'sLoTbB/1AZVdgh30sRyGyDJ7SDutKJE55Dozup9Eeas='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)