UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pBNf0GylYVf5XhikywfhuQTr3cXzkqSfqv9yD/g8RKo='
WHERE
key_id = '23fc2f1c3aa3731449d02c6ac3a24cb9ea0727291f21eef33efc2181cc31fdc6'
AND (
token = 'pBNf0GylYVf5XhikywfhuQTr3cXzkqSfqv9yD/g8RKo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)