UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K5QDS2YRB88t7jz/oS1WoeViLlL/Q/8VjsobFFZUHRc=' 
WHERE 
  key_id = '29d1b878f4e340126309f2b3a3ddfdb0caed1b3872a4cc0b927f62f08bdcd714' 
  AND (
    token = 'K5QDS2YRB88t7jz/oS1WoeViLlL/Q/8VjsobFFZUHRc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027