UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZzM0HmHERy2PPInO+4oCu6AH4VeprlhjdLH0FqW47YA=' 
WHERE 
  key_id = '818364e5ea7d8f1decbf7de2767da7058bff4fe56b8bf0afc3dcde8dc04b00de' 
  AND (
    token = 'ZzM0HmHERy2PPInO+4oCu6AH4VeprlhjdLH0FqW47YA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038