UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U5+asWRtn0cNrrWJBN5QuLGF63NbfU43FJCk8qATmJ0=' 
WHERE 
  key_id = '837f1be2f21f8e8d4f2a587e9e7010e3b071554a22b1a4bdbf1db9430d91636c' 
  AND (
    token = 'U5+asWRtn0cNrrWJBN5QuLGF63NbfU43FJCk8qATmJ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049