UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mV15LSxttVxzXUED2bKDNm43+ejeOoQnYj1hFKSFKeI=' 
WHERE 
  key_id = 'fe97a72ae8629a922bfbd265cbeac68e1e792dfa77db0d184ae9e3fd82a6042e' 
  AND (
    token = 'mV15LSxttVxzXUED2bKDNm43+ejeOoQnYj1hFKSFKeI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033