UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dr7rmydl0mOFe18RixL9/Ma68ofQD1PWv9CqmUTtjLo=' 
WHERE 
  key_id = 'c67941a81f168fad66c8886b272c2c07ce46b00040d0832b2039a2b223267441' 
  AND (
    token = 'dr7rmydl0mOFe18RixL9/Ma68ofQD1PWv9CqmUTtjLo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032