UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k3VltWXbyX/2TLdCDCTXXQWqAjgkQIJn89usUk+W9vo=' 
WHERE 
  key_id = '8a1b5789c06a647691a517518f73278e6561efc1ad8f29c3097e45244659d207' 
  AND (
    token = 'k3VltWXbyX/2TLdCDCTXXQWqAjgkQIJn89usUk+W9vo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029