UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CfI8pW/E+1SNOGwplTbnDTkRDgQ3qzLd4lg6yG9J55I=' 
WHERE 
  key_id = '3e457c051077753a8cd631dde092e1568ac892cf056432d29beb8b8128c7ac82' 
  AND (
    token = 'CfI8pW/E+1SNOGwplTbnDTkRDgQ3qzLd4lg6yG9J55I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037