UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'orGrTt/mvl+apO2iblYa/HzW02kNWijWUZ324it9Lww='
WHERE
key_id = '61e5eb8156b2102e3ba9331f86144f90f548e8a58bcef58e67cc19881ae6129d'
AND (
token = 'orGrTt/mvl+apO2iblYa/HzW02kNWijWUZ324it9Lww='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)