UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8Nbia11RRcoAReYi6T4nThvpCVLc5QTtD4VauBRqKgg='
WHERE
key_id = '7b96e426981935fabdc0b22e406771d784766743403e6dc6bd662c41f68ba9de'
AND (
token = '8Nbia11RRcoAReYi6T4nThvpCVLc5QTtD4VauBRqKgg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)