UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8wibQBx/7OWpqstb4vH8k/d8dUpmBThRmtW8MG0DGAQ=' 
WHERE 
  key_id = 'c56dad61bdf6eb0549eae46ec7df1606c5abbd7ff5b4c8c93dcf8b3147135523' 
  AND (
    token = '8wibQBx/7OWpqstb4vH8k/d8dUpmBThRmtW8MG0DGAQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028