UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GCnBrCcjz0Lt8RTugzcxsZhwE/JBhmQwHdSqEmIz2GA=' 
WHERE 
  key_id = '759dafe088c47fbe31051d36e84d8d9eaf1bb7a86a8898c1ee2d7a77ac5aa726' 
  AND (
    token = 'GCnBrCcjz0Lt8RTugzcxsZhwE/JBhmQwHdSqEmIz2GA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018