UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '808n7vbPYfw15wFXH8doavRKVXYYPcQLKmkIFrlXVPI=' 
WHERE 
  key_id = '56e6d35a559f1129f1a70c2dbaeb87dab58a515364372e7082e289d34f4f3eee' 
  AND (
    token = '808n7vbPYfw15wFXH8doavRKVXYYPcQLKmkIFrlXVPI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031