UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '06sVQbt7d6ZvWz2qSaiElHFBRyVDDvTWPVnDGeHJf5g='
WHERE
key_id = '4d457233c1d41fbbab8038c866321cf4be6e7a3e8b531b75c0d430c28d2848f3'
AND (
token = '06sVQbt7d6ZvWz2qSaiElHFBRyVDDvTWPVnDGeHJf5g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)