UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'amHpvd5510LCflh6+NJ5VwbPEINlk+K8arnVdaaujP0=' 
WHERE 
  key_id = '94d3397ae81e7c4225066d7907d98d1fc9e3841bcf1c474e54e1998a9272e06b' 
  AND (
    token = 'amHpvd5510LCflh6+NJ5VwbPEINlk+K8arnVdaaujP0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025