UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '22Uz4dD/M0dk59CFF5hJyTuwftyHT3I5IbWDzhNnokw=' 
WHERE 
  key_id = '1d422ecbebc05c932ce5b3e6471e5d68a7d3eb04b283ac8eec3d44eab7616a73' 
  AND (
    token = '22Uz4dD/M0dk59CFF5hJyTuwftyHT3I5IbWDzhNnokw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032