UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1++I9QoOyLEhuIuopZd31TUdUwZAfyut1vVrk3MulfE='
WHERE
key_id = 'dd1f963bb59cf08e2271b7b3f9fff19a4f8a517f4e6ca2d12c761d2de8a0458e'
AND (
token = '1++I9QoOyLEhuIuopZd31TUdUwZAfyut1vVrk3MulfE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)