UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w3WqpkBdpzFJXtPMS/e4JJsshlUZa8BSMtTh7nHx094='
WHERE
key_id = 'c5a7cf010f68d097a43bd10ab4abd23841962b5a1cd6873a2bce8a9a3a06b885'
AND (
token = 'w3WqpkBdpzFJXtPMS/e4JJsshlUZa8BSMtTh7nHx094='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)