UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FuyMRftUeUFXWDqXcHkSl9fFTVymUu+2Uc4ygBhwbt4='
WHERE
key_id = '6b77297db13d4485378c834f34e339631ce0672dec152fe940f45e4d72cf2b7d'
AND (
token = 'FuyMRftUeUFXWDqXcHkSl9fFTVymUu+2Uc4ygBhwbt4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)