UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kE3WyzIgiSZ/VMFekQc+KQDr67z5qr7t1bJVk11cP4A=' 
WHERE 
  key_id = 'bb41d813affcca893758fc1ac393779e470f655aa05580e1ae8f68f9c1907d86' 
  AND (
    token = 'kE3WyzIgiSZ/VMFekQc+KQDr67z5qr7t1bJVk11cP4A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037