UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WkMsm2DGKOtIFhBopJ+MpFXUb+Ae2Ev4hcIAMS5qOxg=' 
WHERE 
  key_id = 'cb7fe82488d06e794c462a0fa1c60f9da17604b66c53c4a0d6c3130302e94649' 
  AND (
    token = 'WkMsm2DGKOtIFhBopJ+MpFXUb+Ae2Ev4hcIAMS5qOxg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028