UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zXNuMThvxraylF9F73mUMHrfTh9WCEq7bKBMNyKt8Sw=' 
WHERE 
  key_id = '90de2f4035591188cf67b1fdaa1890b1f760c14bb820f1763304eb16c13ec906' 
  AND (
    token = 'zXNuMThvxraylF9F73mUMHrfTh9WCEq7bKBMNyKt8Sw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022